package com.google.code.qsecurity.server.locator;

import com.google.code.qsecurity.server.domain.User;
import com.google.web.bindery.requestfactory.shared.Locator;


public class UserLocator extends Locator<User, String> {

	@Override
	public User create(Class<? extends User> clazz) {
		return new User();
	}

	@Override
	public User find(Class<? extends User> clazz, String id) {
		// TODO fix
		return create(clazz);
	}

	@Override
	public Class<User> getDomainType() {
		return User.class;
	}

	@Override
	public String getId(User user) {
		return user.getEmail();
	}

	@Override
	public Class<String> getIdType() {
		return String.class;
	}

	@Override
	public Object getVersion(User user) {
		return user.getVersion();
	}

}
